var mongoose = require('mongoose');
var mongoosePaginate = require('mongoose-paginate');
var Schema = mongoose.Schema;
var _ = require("underscore");

//定义model的规范
var newSchema = new Schema({
    name: String, //角色名称
    permissions: [{type: Number, ref: 'UserPermission'}],//权限列表
    create_date: Date//创建时间
});
newSchema.plugin(mongoosePaginate);
//注册model
mongoose.model("UserRole", newSchema);

//获得Model
var UserRole = mongoose.model("UserRole");

module.exports = UserRole;